package com.bhudy.base;

import java.util.List;

class Oracle extends Mysql implements Sql {

    public String keywordLeft = "\"";
    public String keywordRight = "\"";

    public Oracle() {
        super.keywordLeft = this.keywordLeft;
        super.keywordRight = this.keywordRight;
    }

    @Override
    public String getLimitSql(String sql, QueryFilter queryFilter, List<Object> argList) {
        if (queryFilter.limits[0] != null && queryFilter.limits[1] != null) {
            argList.add(queryFilter.limits[0]);
            argList.add(queryFilter.limits[1] + queryFilter.limits[0]);
            sql = "SELECT M.* FROM (" + sql + ") M WHERE RN BETWEEN ? AND ?";
        }
        return sql;
    }

}
